package com.movisol.questionwizard.views.controls;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.movisol.questionwizard.views.R;
import com.movisol.tools.HelperUtils;

public class SmsPopUp extends LinearLayout {
	
	private Button btnOK;
	private Button btnCancelar;
	private TextView tvMessage;
	private ProgressBar progressBar;
	private LinearLayout buttonsLayout;

	public SmsPopUp(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		
		String infService = Context.LAYOUT_INFLATER_SERVICE;
		LayoutInflater li = (LayoutInflater)getContext().getSystemService(infService);
		li.inflate(R.layout.smspopup, this, true);
		
		LinearLayout background = (LinearLayout) findViewById(R.id.LLayoutBackground);
		background.setBackgroundResource(HelperUtils.getDrawableResource("box", context));
		
		btnOK = (Button) findViewById(R.id.btnOk);
		btnCancelar = (Button) findViewById(R.id.btnCancelar);
		tvMessage = (TextView) findViewById(R.id.tvMessage);
		progressBar = (ProgressBar) findViewById(R.id.progressbar);
		buttonsLayout = (LinearLayout) findViewById(R.id.buttonsLayout);

	}
	
	public void changeToWaitingPopupWithMessage(String message)
	{
		buttonsLayout.setVisibility(View.GONE);
		progressBar.setVisibility(View.VISIBLE);
		tvMessage.setText(message);
	}
	
	public void changeToSmsPopUpWithMessage(String message)
	{
		buttonsLayout.setVisibility(View.VISIBLE);
		progressBar.setVisibility(View.GONE);
		tvMessage.setText(message);
	}

	public Button getBtnOK() {
		return btnOK;
	}

	public void setBtnOK(Button btnOK) {
		this.btnOK = btnOK;
	}

	public Button getBtnCancelar() {
		return btnCancelar;
	}

	public void setBtnCancelar(Button btnCancelar) {
		this.btnCancelar = btnCancelar;
	}

	public TextView getTvMessage() {
		return tvMessage;
	}

	public void setTvMessage(TextView tvMessage) {
		this.tvMessage = tvMessage;
	}

	public ProgressBar getProgressBar() {
		return progressBar;
	}

	public void setProgressBar(ProgressBar progressBar) {
		this.progressBar = progressBar;
	}

	public LinearLayout getButtonsLayout() {
		return buttonsLayout;
	}

	public void setButtonsLayout(LinearLayout buttonsLayout) {
		this.buttonsLayout = buttonsLayout;
	}
	

}
